package com.NetSunWeiQin.chapter11.demo;


import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * @author : wushikai
 * <p>
 * date : 2022-04-25
 */
public class ClientDemo {

    public static void main(String[] args) throws RemoteException, NotBoundException {

        Registry registry = LocateRegistry.getRegistry("localhost", 1099);        // 从Registry中检索远程对象的存根/代理

        IRemoteObj remoteQing = (IRemoteObj) registry.lookup("remote");

        String Str = remoteQing.RmiDemo("a");

        System.out.println(Str);
    }
}
